<template>
  <div class="goods-comment-image">
    <div class="list">
      <!-- <a
        href="javascript:;"
        :class="{active:currImage===url}"
        @click="currImage=url"
        v-for="url in pictures"
        :key="url"
      >
        <img :src="url" alt="">
      </a> -->
      <el-image
        v-for="url in pictures"
        :key="url"
        :src="url"
        style="width: 100px; height: 100px"
        :url-list="pictures"
        :preview-src-list="pictures"
        :initial-index="1"
      >
      </el-image>
    </div>
    <div class="preview">

    </div>
  </div>
</template>
<script>
import { ref } from 'vue'
export default {
  name: 'GoodsCommentImage',
  props: {
    pictures: {
      type: Array,
      default: () => []
    }
  },
  setup (props) {
    const currImage = ref(null)
    return { currImage }
  }
}
</script>
<style scoped lang="less">
@import '../../../assets/styles/variable.less';
.goods-comment-image {
  .list {
    display: flex;
    flex-wrap: wrap;
    margin-top: 10px;
    a {
      width: 120px;
      height: 120px;
      border:1px solid #e4e4e4;
      margin-right: 20px;
      margin-bottom: 10px;
      img {
        width: 100%;
        height: 100%;
        // object-fit: contain;
        object-fit: cover;
      }
      &.active {
        border-color: @c;
      }
    }
  }
}
</style>
